<?php
session_start();
      if (isset($_SESSION['k_username'])) {
?>
<html>
<head>
<title >Socios</title>
<style type="text/css">
<!--
.Estilo1 {font-size: 24px}
-->
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="round"><div id="container">
 <div id="content" class="column span-14">
<?php
  include('conexion.inc.php');
  $link = Conectarse();

mysql_select_db("gotica_sociosgotica",$link);

?>

<div align="center" class="Estilo1">LISTA USUARIOS</div>


<table class="one">
<tr align="center">
<?php
if($_SESSION['grupo']==1){ ?>
<td>Edicion</td>
<?php } ?>
<td>Nombres</td>
<td>Nick</td>
<td>Grupo</td>
<td>Email</td>
<td>Telefono</td>

</tr>
<?php
$sql = "SELECT * FROM usuarios Order By descripcion ASC";
$result = mysql_query($sql, $link);
while ($row = mysql_fetch_array($result))
{
echo"<tr align=\"center\">";
if($_SESSION['grupo']==1){ 
echo "<form method=\"post\" action=\"edicionusuario.php\">";
echo "<input type=\"hidden\" value=".$row['id']." name=\"valor\" />";
echo "<td><input type=\"submit\" name=\"edit\" value=\"Editar\" /></td>";
echo "</form>";}
echo "<td>".$row['descripcion']."</td>";
echo "<td>".$row['usuario']."</td>";
$sql2= "Select grupo FROM grupos where idgrupo=".$row['idgrupo'];
$result2 = mysql_query($sql2, $link);
$row2= mysql_fetch_array($result2);
echo "<td>".$row2['grupo']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['telefono']."</td>";
echo"</tr>";
}
?>
</table>
</div>
</div>
</div>
</body>
</html>
<?
}else
{
	echo "<SCRIPT LANGUAGE=\"javascript\">";
echo "location.href = \"index.php\"";
echo "</SCRIPT>";
	}
?>